<layout name='Layout/ace_layout' />
<input type="hidden" name="id" id="id" value="{$vo.id}">
{:W('PageHeader',array('name'=>$forum['name'],'search'=>'N'))}
<div class="operate panel panel-default">
	<div class="panel-body">
		<div class="pull-left">
			<a onclick="go_return_url();" class="btn btn-sm btn-primary">返回</a>
			<if condition="$auth['admin']">
				<a onclick="del();"  class="btn btn-sm btn-danger">删除</a>
			</if>
		</div>
		<div class="pull-right">
			<if condition="$auth['write']">
				<a href="#reply" class="btn btn-sm btn-primary">回复</a>
			</if>
		</div>
	</div>
</div>
<table class="table table-bordered">
	<tr>
		<td style="width:145px">
		<div class="pull-left">
			{$forum.user_name}
		</div></td>
		<td style="width:100%">
		<div  class="pull-left">
			 {$forum.create_time|toDate='Y-m-d H:i'}
			<if condition="($auth['write']) and ($forum.user_id eq $user_id)">
				<a href="" onclick="edit();return false;" class="btn btn-link">编辑</a>
			</if>
		</div>
		<div class="pull-right">
			<a href="#reply" class="btn btn-sm btn-primary">回复</a>
		</div></td>
	</tr>

	<tr>
		<td class="post_left">
		<div class="face">
			<img src="{:get_save_url()}{$forum.user_id|get_user_info=###,pic}" width="120" height="120" border="0" >
		</div></td>
		<td class="post_right">
		<div class="post_content">
			{$forum.content}
		</div>
		<gt name="forum.add_file|strlen" value="2">
			<hr>
			<div class="add_file col-sm-12">
				{$forum.add_file|show_file}
			</div>
		</gt></td>
	</tr>
</table>
<table class="table table-bordered">
	<foreach name="list" item="vo">
		<tr>
			<td style="width:145px">
			<div class="pull-left">
				{$vo.user_name}
			</div></td>
			<td style="width:100%">
			<div  class="pull-left">
				 {$vo.create_time|toDate='Y-m-d H:i'}
				<if condition="($auth['write']) and ($vo.user_id eq $user_id)">
					<a onclick="edit_post({$vo.id});return false;" class="btn btn-link">编辑</a>
				</if>
				<if condition="($auth['admin']) and ($vo.user_id eq $user_id)">
					<a onclick="del_post({$vo.id});return false;" class="btn btn-link">删除</a>
				</if>
			</div>
			<div class="pull-right">
				<a href="#reply" class="btn btn-sm btn-primary">#{$key+1}回复</a>
			</div></td>
		</tr>
		<td style="width:145px;text-align:center;vertical-align:top;padding:0;margin:0;">
			<div class="face">
				<img src="{:get_save_url()}{$vo.user_id|get_user_info=###,pic}" width="120" height="120" border="0" >
			</div>
		</td>
		<td class="post_right">
			<div class="post_content">
				{$vo.content}
			</div>
			<gt name="vo.add_file|strlen" value="2">
				<hr>
				<div class="add_file">
					附件：{$vo.add_file|show_file}
				</div>
			</gt>
			</td>
		</tr>
	</foreach>
</table>
<div class="pagination">
	{$page}
</div>
<if condition="$auth['write']">
	{:W('PageHeader',array('name'=>'回复','search'=>'N'))}
	<a id="reply"></a>
	<form method="post" action="" id="form_data" name="form_data">
		<input type="hidden" id="ajax" name="ajax" value="0">
		<input type="hidden" id="forum_id" name="forum_id" value="{$forum_id}">
		<input type="hidden" id="add_file" name="add_file" value="">
		<input type="hidden" id="opmode" name="opmode" value="add">
		<table class="table table-bordered">
			<tr>
			<td style="width:145px;text-align:center;vertical-align:top;">
			<div class="face">
				<img src="{:get_save_url()}{$user.user_id|get_user_info=###,pic}" width="120" height="120" border="0" >
			</div></td>
			<td style="width:100%;vertical-align:top;">
			<div >
				<textarea  class="editor" name="content" id="content" style="width:100%;height:220px;"></textarea>
			</div></td>
			</tr>
			<tr>
				<td class="text-right">附件：</td>
				<td>
				{:W('File',array('add_file'=>$vo['add_file'],'mode'=>'add'))}
				</td>
			</tr>
		</table>
		<td colspan="2">
	</form>
		<div class="operate panel panel-default">
		<div class="panel-body">
			<div class="pull-left">
				<a onclick="go_return_url();" class="btn btn-sm btn-primary">返回</a>
			</div>
			<div class="pull-right">
				<a onclick="reply();"  class="btn btn-sm btn-primary">提交</a>
			</div>
		</div>
	</div>
</if>
</div>